package br.webchild.client;

import com.smartgwt.client.widgets.Window;
import com.smartgwt.client.widgets.events.ClickEvent;
import com.smartgwt.client.widgets.events.ClickHandler;
import com.smartgwt.client.widgets.layout.VLayout;
import com.smartgwt.client.widgets.toolbar.ToolStrip;
import com.smartgwt.client.widgets.toolbar.ToolStripButton;
import com.smartgwt.client.widgets.toolbar.ToolStripSeparator;

public class Principal extends Window {
	private ToolStripSeparator separador;
	private ToolStripSeparator separador_1;
	private ToolStripSeparator separador_2;
	private ToolStripSeparator separador_3;
	private ToolStripSeparator separador_4;
	private ToolStripSeparator separador_5;
	private final ToolStripSeparator separador_6;
	private final ToolStripSeparator separador_7;
	private ToolStripSeparator separador_8;

	public Principal() {
		this.setTitle("Principal");
		setSize("800px", "520px");
//		setSize("100%", "100%");
		this.setIsModal(true);
		this.setShowMinimizeButton(false);
		this.centerInPage();
		
		VLayout layout = new VLayout();
		
		ToolStrip menu = new ToolStrip();
		menu.setWidth("100%");
		
		ToolStripButton btn_paciente = new ToolStripButton("Paciente");
		btn_paciente.setIcon("/imagens/paciente.png");
		
		ToolStripButton btn_medico = new ToolStripButton("M&eacute;dico");
		btn_medico.setIcon("/imagens/medical_bag.png");
		
		ToolStripButton btn_agenda = new ToolStripButton("Agenda");
		btn_agenda.setIcon("/imagens/agenda.png");
		
		ToolStripButton btn_cid = new ToolStripButton("CID");
		btn_cid.setIcon("/imagens/CID.png");
		
		ToolStripButton btn_usuario = new ToolStripButton("Usu&aacute;rio");
		btn_usuario.setIcon("/imagens/usuario.png");
		
		ToolStripButton btn_consulta = new ToolStripButton("Consulta");
		btn_consulta.setIcon("/imagens/consulta.png");
		
		ToolStripButton btn_sair = new ToolStripButton("Sair");
		btn_sair.setIcon("/imagens/exit-doc.png");
		
		ToolStripButton btn_funcionario = new ToolStripButton("Funcion&aacute;rio");
		btn_funcionario.setIcon("/imagens/funcionario.png");
		
		ToolStripButton btn_relatorio = new ToolStripButton("Relat&oacute;rio");
		btn_relatorio.setIcon("/imagens/relatorio1.png");
		
		ToolStripButton btn_prontuario = new ToolStripButton("Prontu&aacute;rio");
		btn_prontuario.setIcon("/imagens/prontuario.png");
		
		menu.addButton(btn_paciente);
		
		separador = new ToolStripSeparator();
		menu.addMember(separador);
		menu.addButton(btn_medico);
		
		separador_1 = new ToolStripSeparator();
		menu.addMember(separador_1);
		menu.addButton(btn_agenda);
		
		separador_2 = new ToolStripSeparator();
		menu.addMember(separador_2);
		menu.addButton(btn_consulta);
		
		separador_3 = new ToolStripSeparator();
		menu.addMember(separador_3);
		menu.addButton(btn_cid);
		
		separador_4 = new ToolStripSeparator();
		menu.addMember(separador_4);
		menu.addButton(btn_usuario);
		
		separador_5 = new ToolStripSeparator();
		menu.addMember(separador_5);
		menu.addButton(btn_funcionario);
		
		separador_6 = new ToolStripSeparator();
		menu.addMember(separador_6);
		menu.addButton(btn_prontuario);
		
		separador_7 = new ToolStripSeparator();
		menu.addMember(separador_7);
		menu.addButton(btn_relatorio);
		
		separador_8 = new ToolStripSeparator();
		menu.addMember(separador_8);
		menu.addButton(btn_sair);
		
		
//		****************ADICIONA O MENU AO LAYOUT*************************
		layout.addMember(menu);
						
		addItem(layout);
		
		btn_medico.addClickHandler(new ClickHandler() {
			
			@Override
			public void onClick(ClickEvent event) {
				new Medico().show();
			}
		});
		
		btn_paciente.addClickHandler(new ClickHandler() {
			
			@Override
			public void onClick(ClickEvent event) {
				new Paciente().show();
			}
		});
		
		btn_agenda.addClickHandler(new ClickHandler() {
			
			@Override
			public void onClick(ClickEvent event) {
				new Agenda().show();
			}
		});
		
		btn_consulta.addClickHandler(new ClickHandler() {
			
			@Override
			public void onClick(ClickEvent event) {
				new Consulta().show();
			}
		});
		
		btn_funcionario.addClickHandler(new ClickHandler() {
			
			@Override
			public void onClick(ClickEvent event) {
				new Funcionario().show();
			}
		});
		
		btn_prontuario.addClickHandler(new ClickHandler() {
			
			@Override
			public void onClick(ClickEvent event) {
				new Prontuario().show();
			}
		});
		
		btn_usuario.addClickHandler(new ClickHandler() {
			
			@Override
			public void onClick(ClickEvent event) {
				new Usuario().show();
			}
		});
		
		btn_sair.addClickHandler(new ClickHandler() {
			
			@Override
			public void onClick(ClickEvent event) {
				destroy();
			}
		});
	}
}
